import model.map.GameMap;
import model.map.GameTile;
import model.map.MapMaker;
import model.mapping.ResourceMapping;
import model.resource.MapResourcePopulator;


public class ResourceTester
{
	public static void main(String[] args)
	{
		GameMap map = MapMaker.mapMaker.getNewMap();
		MapResourcePopulator mrp = MapResourcePopulator.getResourcePopulator();
		ResourceMapping rm = ResourceMapping.getResourceMapping();
		
		mrp.populate(map);
		
		for (int i = 0; i < map.getMapLength(); i++)
		{
			for (int j = 0; j < map.getMapHeight(); j++)
			{
				GameTile tile = map.getTileAt(i, j);
				System.out.println(tile);
				
				System.out.println("Food: " + rm.getFood(tile));
				System.out.println("Ore: " + rm.getOre(tile));
				System.out.println("Energy: " + rm.getEnergy(tile));
				System.out.println();
			}
		}
		
		GameTile harvestTest = map.getTileAt(3, 3);
		
		System.out.println("Before harvest:\n" + harvestTest);
		
		System.out.println("Food: " + rm.getFood(harvestTest));
		System.out.println("Ore: " + rm.getOre(harvestTest));
		System.out.println("Energy: " + rm.getEnergy(harvestTest));
		System.out.println();
		
		System.out.println(rm.harvestFood(harvestTest, 5000));
		System.out.println(rm.harvestOre(harvestTest, 30));
		System.out.println(rm.harvestEnergy(harvestTest, 30));
		
		System.out.println("After harvest:\n" + harvestTest);
		
		System.out.println("Food: " + rm.getFood(harvestTest));
		System.out.println("Ore: " + rm.getOre(harvestTest));
		System.out.println("Energy: " + rm.getEnergy(harvestTest));
		System.out.println();
		
		System.out.println("After renewing:");
		mrp.getResourceManager().update();
		System.out.println("Food: " + rm.getFood(harvestTest));
		System.out.println("Ore: " + rm.getOre(harvestTest));
		System.out.println("Energy: " + rm.getEnergy(harvestTest));
		System.out.println();
		
	}
}
